package com.lebron.kotlin.ui.adapter

import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentStatePagerAdapter
import com.lebron.kotlin.BaseApplication
import com.lebron.kotlin.R
import com.lebron.kotlin.ui.fragment.BaseFragment

/**
 * @Author lebron
 * @Date 18-7-31-上午11:52
 */
class MovieViewPagerAdapter(fm: FragmentManager?,var fragments : ArrayList<BaseFragment>) : FragmentStatePagerAdapter(fm) {

    var titles : Array<String> = BaseApplication.instance.applicationContext.resources.getStringArray(R.array.movie_tab_type)

    override fun getCount(): Int {
        return fragments.size
    }

    override fun getItem(position: Int): Fragment {
       return fragments[position]
    }


    override fun getPageTitle(position: Int): CharSequence? {
        return titles[position]
    }


}